<template>
  <div>
    <div class="shebeiliebiao">
      <con-title :topTitle="topTitle"></con-title>
      <template>
        <el-table :data="measurementList" style="width: 100%" class="table">
          <el-table-column type="index" label="序号" width="100" align="center">
          </el-table-column>
          <el-table-column
            prop="id"
            label="测量ID"
            width="180"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="name"
            label="测量名称"
            width="180"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="unit" label="测量单位" align="center">
          </el-table-column>
          <el-table-column label="创建时间" align="center">
            <template slot-scope="scope">
              {{ scope.row.cTime | time }}
            </template>
          </el-table-column>
          <el-table-column label="更新时间" align="center">
            <template slot-scope="scope">
              {{ scope.row.uTime | time1 }}
            </template>
          </el-table-column>
          <el-table-column prop="username" label="操作" align="center">
            <el-row>
              <el-button type="primary" icon="el-icon-edit" circle></el-button>

              <el-button type="danger" icon="el-icon-delete" circle></el-button>
            </el-row>
          </el-table-column>
        </el-table>
      </template>
    </div>
  </div>
</template>

<script>
import { $measurementList } from "@/api/index";
import ConTitle from "@/components/ConTitle.vue";
import moment from "moment";
moment.locale("zh-cn");
export default {
  components: { ConTitle },
  name: "leiXing",
  data() {
    return {
      topTitle: {
        type: "自定义类型",
        text: "测量类型",
        msg: "展示所有自定义的测量类型，提供了添加测量类型，修改测量类型，删除测量类型等功能",
      },
      measurementList: [],
    };
  },
  mounted() {
    $measurementList().then((res) => {
      console.log(res);
      this.measurementList = res.data.data;
    });
  },
  filters: {
    time(value) {
      return moment(value).format("LL");
    },
    time1(value) {
      return moment(value).format("LL");
    },
  },
};
</script>

<style lang="scss" scoped>
.shebeiliebiao {
  margin: 10px;
}
.table {
  margin-top: 10px;
}
</style>